package com.shop.api.feign;

import com.shop.pojo.LdbzSearchLeftAd;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 作者:  郝炳凯
 */
@FeignClient(name = "shop-service-advertisement")
public interface SearchLeftAdFeign {

    /**
     * 获取索引轮播广告页面
     * @param entity
     * @param start
     * @param limit
     * @return
     */
    @RequestMapping(value = "/search/left/ad/page", method = RequestMethod.GET)
    List<LdbzSearchLeftAd> getSearchLeftAdPage(@RequestParam("entity") LdbzSearchLeftAd entity, @RequestParam("start") int start, @RequestParam("limit") int limit);

    /**
     * 获取索引轮播广告数量
     * @param entity
     * @return
     */
    @RequestMapping(value = "/search/left/ad/count", method = RequestMethod.GET)
    long countByEntity(@RequestParam("entity") LdbzSearchLeftAd entity);

    /**
     * 根据id获取索引轮播广告
     * @param id
     * @return
     */
    @RequestMapping(value = "/search/left/ad/select/{id}", method = RequestMethod.GET)
    LdbzSearchLeftAd selectByKey(@RequestParam("id") Long id);

    /**
     * 删除索引轮播广告
     * @param id
     * @return
     */
    @RequestMapping(value = "/search/left/ad/delete/{id}", method = RequestMethod.GET)
    int deleteByKey(@RequestParam("id") Long id);

    /**
     * 批量删除索引轮播广告
     * @param ids
     * @return
     */
    @RequestMapping(value = "/search/left/ad/deleteByKeys/", method = RequestMethod.GET)
    int deleteByKeys(@RequestParam("ids") List<Long> ids);

    /**
     * 添加索引轮播广告
     * @param entity
     * @return
     */
    @RequestMapping(value = "/search/left/ad/insert", method = RequestMethod.GET)
    int insertByEntity(@RequestParam("entity") LdbzSearchLeftAd entity);

    /**
     * 修改索引轮播广告
     * @param entity
     * @return
     */
    @RequestMapping(value = "/search/left/ad/update", method = RequestMethod.GET)
    int updateByKey(@RequestParam("entity") LdbzSearchLeftAd entity);

    /**
     * 获取索引轮播广告
     * @return
     */
    @RequestMapping(value = "/search/left/ad/redis", method = RequestMethod.GET)
    List<LdbzSearchLeftAd> getSearchLeftAdByRedis();
}
